package com.ys.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.ys.entity.WalletDeposit;
import com.ys.entity.WalletWithdraw;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 提币表 Mapper 接口
 * </p>
 *
 * @author zpf
 * @since 2018-03-26
 */
@Repository
public interface WalletWithdrawDao extends BaseMapper<WalletWithdraw> {

    /**
     * 根据链类型，和当前块数更新充值状态
     * @param walletWithdraw
     * @param confirmBlcokNum
     * @return
     */
    @Update(" update wallet_withdraw set status=30 where ${arg0.blockNum}-blockNum>=#{arg1} " +
            " and status<30 and currencyChainType=#{arg0.currencyChainType} ")
    int updateWithdrawStatus(WalletWithdraw  walletWithdraw, Integer confirmBlcokNum);

}
